/**
 * 
 * 服务器访问地址
 */
var forumHost = "http://www.yeeyi.com/bbs/forum.php?jsoncallback=?&mod=mobile";


/**
 * base64 加密对象初始化
 */
var b64 = new Base64();

function xmlHttp(url,callback){
	if(url == ''){
		uexWindow.alert('参数错误','请求地址不能为空！','返回');
	}else{
		var platform = getLocalStorge('platform');
		url = url + "&pf="+platform;
		$.getJSON(url,callback);
	}
}

/**
 * 获取板块名称
 */
function getForumName(){
	var fid = localStorage.getItem('fid');
	var furl = forumHost + '&ac=forumname&fid='+fid;
	xmlHttp(furl,showForumName);
}

/**
 * 板块名称回调函数，更改头部板块名称
 * @param {Object} data
 */
function showForumName(data){
	var returnCode = data.code;
	if(returnCode == '200'){
		$("#head").text(b64.decode(data.fname));
	}
}

function confirmSuccess(opId,dataType,data){
		if (data == 0) {
			localStorage.setItem('returnType','forum_list');
			uexWindow.open('login','0','login.html','1','100%','100%','0');
		}
}

function getLocalStorge(key){
	var item = localStorage.getItem(key);
	if(item=='' || item==null || typeof(item)=="undefined"){
		return false;
	}else{
		return item;
	}
}


function showMenu(){
	var uid = getLocalStorge('uid');
	if(!uid){
		var confirmButtom = new Array();
		confirmButtom[0] = '登录';
		confirmButtom[1] = '返回';
		uexWindow.confirm('提示：','您还未登陆，是否登录？',confirmButtom);
		return false;
	}else{
		uexWindow.evaluatePopoverScript('','content','scrollToTop()');
	}
}